
import { createApp } from 'vue'
import { createPinia } from 'pinia'  //引入pinia
import persist from 'pinia-plugin-persistedstate'
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
import MyComponents from '@/components/index' //引入自定义全局插件
import BaiduMap from 'vue-baidu-map-3x'
import 'echarts'
import echarts from 'vue-echarts'
import AreaSelector from "@luohc92/vue3-area-selector";
// import "@luohc92/vue3-area-selector/dist/style.css";


import { registerMap } from 'echarts/core' //引入registerMap
import ZJJson from '@/lib/ZJ.js'
import CHINAJson from '@/lib/CHINA.js'
registerMap('ZJ',ZJJson)
registerMap('CHINA',CHINAJson)


const app = createApp(App)
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
const pinia = createPinia()

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(pinia.use(persist)) 
app.use(BaiduMap,{
  ak:'pp7tZwclxHhXPTfrgggiTCGIw5u1bqAm',
})
app.component('v-chart',echarts)
app.use(router)
app.use(AreaSelector)
app.use(MyComponents) // 全局注册我们自定义的插件
app.use(ElementPlus, {
  locale: zhCn,
})
app.mount('#app')
